Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

Mail Rules - Script to clear and disable mail rules in the mailbox
~Chloe Fezreplop 28.Jan.04 03:43 AM a Web browser
General 6.5 Windows 2000


http://www-10.lotus.com/ldd/46dom.nsf/0/8cc83a66cc33d86985256bc3004d8792?OpenDocument


Use this script to remove any $FilterFormula_xx information from the Calendar Profile. We added an Agent to our mail template. The user can then pick this from the actions menu.


Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.currentdatabase
Dim workspace As New NotesUIWorkspace

'This folder contains all the Mail Rules.
Dim folder As NotesView
Set folder = db.GetView("(Rules)")

'Find the calendar profile document in the current database. (GetProfileDocument will create the named profile document if it does not already exist.)
Dim calendarProfile As NotesDocument
Set calendarProfile = db.GetProfileDocument( "CalendarProfile" )

'Mail Rules are compiled and saved in special fields named $FilterFormula_xx
'Remove all of these fields from the calendar profile.
Forall item In calendarProfile.Items
If( Lcase$(Left$(item.Name,15)) = "$filterformula_" ) Then
Print "Cleanup " & item.Name
Call item.Remove
End If
End Forall

'Save changes to the calendar profile.
Call calendarProfile.Save( False, False )

'Disable all Rules.
Dim mailrule As NotesDocument
Set mailrule = folder.GetFirstDocument
While Not( mailrule Is Nothing )
Call mailrule.ReplaceItemValue( "Enable","0" )
Call mailrule.Save( True,False,True )

Set mailrule = folder.GetNextDocument( mailrule )
Wend

'Open the Rules folder
Call workspace.OpenDatabase( db.Server, db.FilePath, "(Rules)" )

'Message to the user.
Messagebox "Cleanup complete."




SOLUTION: Mail Rules & "Monitor can... (~Patti Nimkrovi... 27.Jan.04)
. . Before you delete a Rule, you must ... (~Dan Elhipister... 27.Jan.04)
. . . . Spoke too soon... (~Chris Quetwebe... 27.Jan.04)
. . That was not the solution, but this... (~Chris Quetwebe... 27.Jan.04)
. . . . Mail Rules - Script to clear and di... (~Chloe Fezreplo... 28.Jan.04)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS